<?php

/**
 * rest actions.
 *
 * @package    vicounter
 * @subpackage rest
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class restActions extends sfActions
{
 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
  public function executeIndex(sfWebRequest $request)
  {
    $this->forward('default', 'module');
  }
  
  public function executeShow(sfWebRequest $request)
  {
  	//$this->visitor = Doctrine_Core::getTable('Visitor')->getVisitorObj();
	  $this->callback = $request->getGetParameter("callback", "null");
		$retData = array();
		if ($request->isXmlHttpRequest()) {
			$data = array('product' => 'IBM', 'price' => '134');
			$json = json_encode($data);
			$json = $request->getGetParameter("callback","null").'('.$json.')';
			$this->renderText($json);
  	}
  	return sfView::NONE;
  }
}
